package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;


/**
 * Created by VegetaKo on 2016/11/20.
 */
@Entity
@DynamicInsert
@Table(name = "salesman_rankinglist", catalog = "")
public class SalesmanRankinglist extends BaseEntity {
    private String salesmanNo;
    private String salesmanName;
    private BigDecimal nights;
    private BigDecimal members;
    private BigDecimal nightsRewards;
    private BigDecimal membersRewards;
    private BigDecimal rewards;
    private Date bizDatetime;
    private Integer week;
    private Integer month;
    private Integer quarter;
    private Integer year;

    public enum SalesmanRankinglist_{
        salesmanNo,salesmanName,nights,members,nightsRewards,membersRewards,rewards,bizDatetime,week,month,quarter,year
    }

    @Basic
    @Column(name = "salesman_no", nullable = true, length = 64)
    public String getSalesmanNo()
    {
        return salesmanNo;
    }

    public void setSalesmanNo(String salesmanNo) {
        this.salesmanNo = salesmanNo;
    }

    @Basic
    @Column(name = "salesman_name", nullable = true, length = 32)
    public String getSalesmanName() {
        return salesmanName;
    }

    public void setSalesmanName(String salesmanName) {
        this.salesmanName = salesmanName;
    }

    @Basic
    @Column(name = "nights", nullable = true, precision = 2)
    public BigDecimal getNights() {
        return nights;
    }

    public void setNights(BigDecimal nights) {
        this.nights = nights;
    }

    @Basic
    @Column(name = "members", nullable = true, precision = 2)
    public BigDecimal getMembers() {
        return members;
    }

    public void setMembers(BigDecimal members) {
        this.members = members;
    }

    @Basic
    @Column(name = "nights_rewards", nullable = true, precision = 2)
    public BigDecimal getNightsRewards() {
        return nightsRewards;
    }

    public void setNightsRewards(BigDecimal nightsRewards) {
        this.nightsRewards = nightsRewards;
    }

    @Basic
    @Column(name = "members_rewards", nullable = true, precision = 2)
    public BigDecimal getMembersRewards() {
        return membersRewards;
    }

    public void setMembersRewards(BigDecimal membersRewards) {
        this.membersRewards = membersRewards;
    }

    @Basic
    @Column(name = "rewards", nullable = true, precision = 2)
    public BigDecimal getRewards() {
        return rewards;
    }

    public void setRewards(BigDecimal rewards) {
        this.rewards = rewards;
    }

    @Basic
    @Column(name = "biz_datetime", nullable = true)
    public Date getBizDatetime() {
        return bizDatetime;
    }

    public void setBizDatetime(Date bizDatetime) {
        this.bizDatetime = bizDatetime;
    }

    @Basic
    @Column(name = "week", nullable = true)
    public Integer getWeek() {
        return week;
    }

    public void setWeek(Integer week) {
        this.week = week;
    }

    @Basic
    @Column(name = "month", nullable = true)
    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    @Basic
    @Column(name = "quarter", nullable = true)
    public Integer getQuarter() {
        return quarter;
    }

    public void setQuarter(Integer quarter) {
        this.quarter = quarter;
    }

    @Basic
    @Column(name = "year", nullable = true)
    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SalesmanRankinglist that = (SalesmanRankinglist) o;

        if (salesmanNo != null ? !salesmanNo.equals(that.salesmanNo) : that.salesmanNo != null) return false;
        if (salesmanName != null ? !salesmanName.equals(that.salesmanName) : that.salesmanName != null) return false;
        if (nights != null ? !nights.equals(that.nights) : that.nights != null) return false;
        if (members != null ? !members.equals(that.members) : that.members != null) return false;
        if (nightsRewards != null ? !nightsRewards.equals(that.nightsRewards) : that.nightsRewards != null) return false;
        if (membersRewards != null ? !membersRewards.equals(that.membersRewards) : that.membersRewards != null) return false;
        if (rewards != null ? !rewards.equals(that.rewards) : that.rewards != null) return false;
        if (bizDatetime != null ? !bizDatetime.equals(that.bizDatetime) : that.bizDatetime != null) return false;
        if (week != null ? !week.equals(that.week) : that.week != null) return false;
        if (month != null ? !month.equals(that.month) : that.month != null) return false;
        if (quarter != null ? !quarter.equals(that.quarter) : that.quarter != null) return false;
        if (year != null ? !year.equals(that.year) : that.year != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = salesmanNo != null ? salesmanNo.hashCode() : 0;
        result = 31 * result + (salesmanName != null ? salesmanName.hashCode() : 0);
        result = 31 * result + (nights != null ? nights.hashCode() : 0);
        result = 31 * result + (members != null ? members.hashCode() : 0);
        result = 31 * result + (nightsRewards != null ? nightsRewards.hashCode() : 0);
        result = 31 * result + (membersRewards != null ? membersRewards.hashCode() : 0);
        result = 31 * result + (rewards != null ? rewards.hashCode() : 0);
        result = 31 * result + (bizDatetime != null ? bizDatetime.hashCode() : 0);
        result = 31 * result + (week != null ? week.hashCode() : 0);
        result = 31 * result + (month != null ? month.hashCode() : 0);
        result = 31 * result + (quarter != null ? quarter.hashCode() : 0);
        result = 31 * result + (year != null ? year.hashCode() : 0);
        return result;
    }
}
